<!--
 * @Author: rafa
 * @Date: 2021-06-15 16:35:00
 * @LastEditors: rafa
 * @LastEditTime: 2021-06-15 16:35:00
 * @Description: 文件说明
 * @FilePath: \vue-base\src\views\cancelToken\cancelToken.vue
-->
<template>
    <div>
        <van-cell>
            <van-button type="primary" @click="handel">请求接口</van-button>
        </van-cell>


        <van-cell>
            请求响应次数{{requestCount}}
        </van-cell>
    </div>
</template>

<script>
import { getDemoData2 } from '@/api/home'
import Vue from 'vue';
import { Cell, Button } from 'vant';

Vue.use(Cell);
Vue.use(Button);
export default {
  name: 'cancelToken',
  data() {
    return {
      requestCount: 0
    }
  },
  methods: {
    handel() {
      getDemoData2().then(res => {
        this.$toast(res.data)
        this.requestCount++
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
